<template>
    <div v-resize="handleResize" class="ivu-mt-64">
        <base-info ref="baseInfo" />
    </div>
</template>
<script>
    import baseInfo from './base-info';

    export default {
        name: 'myReport',
        components: { baseInfo },
        data () {
            return {
                visitType: 'day', // day, month, year
                visitDate: [(new Date()), (new Date())]
            }
        },
        methods: {
            handleChangeVisitType (val) {
                if (val === 'week') {
                    this.visitDate = [(new Date() - 86400000 * 7), (new Date())];
                } else if (val === 'month') {
                    this.visitDate = [(new Date() - 86400000 * 30), (new Date())];
                } else if (val === 'year') {
                    this.visitDate = [(new Date() - 86400000 * 365), (new Date())];
                }
            },
            // 监听页面宽度变化，刷新表格
            handleResize () {
                this.$refs.visitChart.handleResize();
            }
        }
    }
</script>
<style lang="less">
    .dashboard-console-visit{
        .ivu-radio-group-button .ivu-radio-wrapper{
            border: none !important;
            box-shadow: none !important;
            padding: 0 12px;
        }
        .ivu-radio-group-button .ivu-radio-wrapper:before, .ivu-radio-group-button .ivu-radio-wrapper:after{
            display: none;
        }
    }
    .ivu-mt-64 {
        margin-top:64px;
    }
</style>
